<template>
  <div class="hello">
    <button @click="getStudents">获取信息</button>

    <div v-html="yemian"></div>
  </div>
</template>

<script>
  import axios from "axios";
export default {
  name: 'HelloWorld',
  data(){
    return{
      yemian:''
    }
  },
  props: {
  },
  methods: {
    getStudents() {
      axios.get("/atguigu").then(
              (response) => {
                console.log("请求成功", response.data);
                this.yemian=response.data
              },
              (error) => {
                console.log("请求失败", error.message);
              }
      );
    },
}
}
</script>
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
